#ifndef __WORLD_H__
#define __WORLD_H__

#include "SocketBase.h"
#include "WorldSession.h"
#include <map>

#define sWorld World::GetInstance()

class World
{
public:
	World();
	~World();
	static World* GetInstance();
	WorldSession* CreateNewSession(HSocket _socket);
	void RemoveSession(HSocket _socket);
	WorldSession* FindSession(HSocket _socket);
private:
	std::mutex SessionMapLocker;
	std::map<HSocket, WorldSession*> SessionMap;
};

#endif